#ifndef PLAYSCENE2_H
#define PLAYSCENE2_H

#include <QMainWindow>
#include"map.h"
#include<QTimer>
#include"hero.h"
#include"bullet.h"
#include<QKeyEvent>
#include"enemy.h"
#include"bomb.h"

class playscene2 : public QMainWindow
{
    Q_OBJECT
public:
    explicit playscene2(QWidget *parent = nullptr);

    void initscene();

    //更新各元素坐标
    void updatePostion();

    void paintEvent(QPaintEvent*);

    void mouseMoveEvent(QMouseEvent*);

    void keyPressEvent(QKeyEvent *);

    hero heli=hero(":/res/spacecraft1.png");

    int herolife=3;

    Map *map=new Map(1);    

    //场景刷新定时器
    QTimer m_timer;

    //敌机出场
    void enemyCome();
    //敌机数组
    enemy enemys[20]={enemy(1),enemy(1),enemy(1),enemy(1),enemy(1),enemy(1),enemy(1),enemy(2),enemy(2),enemy(2),enemy(2),enemy(2),enemy(2),
                     enemy(2),enemy(3),enemy(3),enemy(3),enemy(3),enemy(3),enemy(3)};
    //敌机出场时间间隔
    int e_recoder;

    //碰撞检测
    void collisionDetec();

    //爆炸数组
    bomb bombs[20];

    bool isRun=true;


signals:

     //返回信号
     void chooseBack();

     void gameover();

};


#endif // PLAYSCENE2_H
